﻿using System;
using Autodesk.Revit.UI;

namespace YArchitech.HVAC.AuxiliaryCurve
{
	public class PointSelection : AuxiliarySelection
	{
		public PointSelection(ExternalCommandData cmd)
		{
			this.m_cmd = cmd;
			this.sel = this.m_cmd.Application.ActiveUIDocument.Selection;
		}

		public override bool Select()
		{
			base.Min = this.sel.PickPoint("选择矩形区域第一点");
			base.Max = this.sel.PickPoint("选择矩形区域第二点");
			while (base.Min.DistanceTo(base.Max) <= this.m_cmd.Application.Application.ShortCurveTolerance)
			{
				base.Min = this.sel.PickPoint("选择矩形区域第一点");
				base.Max = this.sel.PickPoint("选择矩形区域第二点");
			}
			return true;
		}
	}
}
